import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/home/HomeView.vue'
import Home from '@/views/Home.vue'
import HomeMain from '@/views/HomeMain.vue'
import UsersView from '@/views/UsersView.vue'
import Dashboard from '@/views/Dashboard.vue'
import Introduce from '@/views/Introduce.vue'

const routes = [
  {
     path:'/',
     component: Home,
     redirect: '/introduce',
     children: [
       {
          path: '/home',
          name: 'homemain',
          component: HomeMain
       },
       {
          path: 'usersview',
          name: 'usersview',
          component: UsersView
       },
       {
          path: 'dashboard',
          name: 'dashboard',
          component: Dashboard
       },
       {
          path: 'introduce',
          name: 'introduce',
          component: Introduce
       }
     ]
  },

  {
     path: '/main',
     name: 'home',
     component: HomeView
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
